package com.easymin.weixin.service;

import com.easymin.weixin.entity.WxBind;
import com.easymin.weixin.entity.WxBindCriteria;

public interface WxBindService extends BaseService<WxBind, WxBindCriteria, Long> {

  /**
   * 根据id,appKey删除绑定信息.
   */
  int delete(Long id, String appKey);

  /**
   * 根据openId,appKey查询绑定信息.
   */
  WxBind findByOpenIdAndAppKey(String openId, String appKey);

  /**
   * 根据phone,appKey查询绑定信息.
   */
  WxBind findByPhoneAndAppKey(String phone, String appKey);

  /**
   * 根据phone,openId,appKe查询绑定信息.
   */
  WxBind findOne(String phone, String openId, String appKey);

  /**
   * 根据AppKey与openId删除绑定信息.
   */
  int deleteByOpenId(String appKey, String openId);

  /**
   * 根据Appkey与phone删除绑定信息.
   */
  int deleteByPhone(String appKey, String phone);
}
